/**
 * Created by Administrator on 15-10-8.
 */
window.onload=function() {
var url=getUrl();
    var id = $.getUrlParam("id");
    var cluckId = $.getUrlParam("cluckId");
    var userid=getUserId();
    $("#tfbdty").attr('href','tade_tongyou_fabu.html?id='+id);
    $("#tbmdty").attr('href','tade_tongyou_baoming.html?id='+id);
    $("#edit").attr('href','tade_guanzhu.html?id='+id);
    $("#tdhc").attr('href','tade_huace.html?id='+id);
    $.jsonp({
        url: 'http://'+url+'/api/user/'+id+'/select',
        data: {},
        callbackParameter: "callback",
        success: function (data,textStatus,xOptions) {
            var photo=data.user.photo;
            $("#photo").attr('src',photo);
            var nickName=data.user.nickName;
            $("#nickName").text(nickName);
        },
        error: function (xOptions, textStatus) {
        }

    });

    $.jsonp({
        url: 'http://'+url+'/api/sameway/mysameway',
        data: {userId:id},
        callbackParameter: "callback",
        success: function (data, textStatus, xOptions) {


    var sex=data.sex;
            if(data.sex==1){
                $("#sexicon").addClass("icons-sex-male");
                $("#sex").addClass("sex sex-male");
                //icons-sex-female
            }else{
                $("#sexicon").addClass("icons-sex-female");
                $("#sex").addClass("sex sex-female");
            }

    var age = data.age;
    $("#age").text(age);
    var charisma = data.charisma;
    $("#charisma").text(charisma);
    var billing=data.billing;
    $("#billing").text(billing);
        },
        error: function (xOptions, textStatus) {
        }
    })


}